package chapter14.Homework;

import java.util.*;

/**
 * @Auther: Tx
 * @Date: 2022/5/25 23:19
 */
@SuppressWarnings("all")
public class Homework03 {
    public static void main(String[] args) {
        Map m = new HashMap();
        m.put("jack", 650);
        m.put("tom", 5210);
        m.put("smith", 123456);
//        1.将jack的工资修改为2600
        m.put("jack", 2600);
//        2.将所有员工工资加100
        System.out.println(m.values());
        Set set = m.keySet();
        for (Object key : set) {
            m.put(key, (Integer) m.get(key) + 100);
        }
        System.out.println(m);


//    3.遍历集合中的所有员工
        Set entrySet = m.entrySet();
        Iterator iterator = entrySet.iterator();
        while (iterator.hasNext()) {
           Map.Entry entry = (Map.Entry)iterator.next();
            System.out.println(entry.getKey()+"  "+entry.getValue());
        }
        System.out.println("工资："+m.values());

    }
}